package com.key.win.system.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.key.win.base.web.PageRequest;
import com.key.win.base.web.PageResult;
import com.key.win.system.model.SysOrgan;
import com.key.win.system.model.SysOrganUser;

import java.util.List;
import java.util.Set;

public interface SysOrganService extends IService<SysOrgan> {

    PageResult<SysOrgan> findSysOrganByPaged(PageRequest<SysOrgan> t);

    PageResult<SysOrgan> findChildrenNodeByParentId(PageRequest<SysOrgan> t);
    
    PageResult<SysOrgan> findParentNodeByParentId(PageRequest<SysOrgan> t);

    List<SysOrgan> findSysOrgan(SysOrgan sysOrgan);

    List<SysOrgan> findSysOrganByParentId(String parentId);

    List<SysOrgan> getOrganTree();

    List<SysOrgan> findLeafNode();

    boolean saveOrUpdateOrgan(SysOrgan sysOrgan);

    List<SysOrgan> findSysOrganByUserId(String userId);

    boolean deleteById(String id);

    SysOrgan getOrganFullById(String id);

    void setUserToOrgan(String id, Set<String> userIds);

    void setUserToOrgan(String id, List<SysOrganUser> sysOrganUsers);

    List<SysOrgan> getSysOrganByIds(Set<String> ids);
}
